/**
 * @file /include/st_biotac_gui/biotacgui.hpp
 * @author Tomonori Yamamoto <tomonori.yamamoto@syntouchllc.com>
 *         (originally written by Daniel Stonier)
 * @date December 02, 2011
 * @brief Qt based GUI for BioTca
 **/
#ifndef biotacgui_h
#define biotacgui_h

/*****************************************************************************
** Includes
*****************************************************************************/

#include <QtGui/QMainWindow>
#include <boost/array.hpp>
#include "ui_biotacgui.h"
#include "qnode.hpp"

/*****************************************************************************
** Namespace
*****************************************************************************/

namespace syntouch_biotac_gui {

/*****************************************************************************
** Interface [MainWindow]
*****************************************************************************/
/**
 * @brief Qt central, all operations relating to the view part here.
 */
class BioTacGui : public QMainWindow, public Ui_BioTacGuiWindow
{
  Q_OBJECT

public:
  BioTacGui(int argc, char** argv, QWidget *parent = 0);
  ~BioTacGui();
  void convertRawToRgb(qreal value);

protected:
  void paintEvent(QPaintEvent *event);
  
public slots:
  void on_startButton_clicked();
  void on_closeButton_clicked();
  void updateGui();
  void closeGui();
  
private:
  static const int width_;
  static const int height_;
  static const int font_size_1_;
  static const int font_size_2_;
  static const int num_sensing_electrodes_;
  static const int num_excitation_electrodes_;
  static const BiotacData *data_ptr_;
  int red_;
  int green_;
  int blue_;
  QRectF sensing_electrode_[19];
  QRectF excitation_electrode_[4];

  int bt_index_; 

private:
  QNode qnode_;
  Ui::BioTacGuiWindow *ui_;
};
  
}  // namespace syntouch_biotac_gui

#endif // biotacgui_h
